package router

import (
	"api-gateway/basic/config"
	"api-gateway/handler/api"
	"api-gateway/midderware"
	"github.com/gin-gonic/gin"
)

func ShopCarRouter(v1 *gin.RouterGroup) {
	shopCar := v1.Group("/shopCar")
	{
		shopCar.Use(midderware.JWTAuth(config.KEY_JWT))
		shopCar.POST("/setInShopCar", api.SetInShopCar)                      // 加入购物车-
		shopCar.POST("/addShopCarNum", api.AddShopCarNum)                    // 增加购物车商品数量 （+1）-
		shopCar.POST("/popShopCarNum", api.PopShopCarNum)                    // 扣减购物车商品数量 （-1）-
		shopCar.POST("/updateShopCarNum", api.UpdateShopCarNum)              // 直接修改购物车商品数量 -
		shopCar.GET("/getShopCarAllPrice", api.GetShopCarAllPrice)           // 获取购物车所有商品总价 -
		shopCar.GET("/shopCarList", api.ShopCarList)                         // 购物车商品列表 -
		shopCar.POST("/cleanShopCar", api.CleanShopCar)                      // 清空购物车-
		shopCar.GET("/userSearchShopCarByName", api.UserSearchShopCarByName) // 查询购物车收藏的商品 -
		shopCar.POST("/delOneShopCar", api.DelOneShopCar)                    // 删除某 redis 数据 -
	}
}
